﻿using Rud.Holmgren.TabulexLib.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rud.Holmgren.Tabulex3000.Util
{
    interface ICommunicationTask
    {
        IPromise<bool> Run();

        string Caption { get; }
        bool ShowCaption { get; }
    }

    abstract class CommunicationTaskBase : ICommunicationTask
    {
        public CommunicationTaskBase(string caption)
        {
            Caption = caption;
            ShowCaption = !String.IsNullOrWhiteSpace(caption);
        }

        public abstract IPromise<bool> Run();

        public string Caption { get; protected set; }
        public bool ShowCaption { get; protected set; }
    }
}
